package com.wc._16届国特冲刺营._11图论_并查集三板斧.修改数组;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/5/29 16:11
 * @description
 * https://www.lanqiao.cn/courses/51805/learning/?id=4072944&compatibility=false
 */
public class Main {
    /**
     * 并查集的祖先理解
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 2000010;
    static int[] p = new int[N];
    static int[] a = new int[N], l = new int[N], r = new int[N];
    static boolean[] st = new boolean[N];
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 1; i < N; i++) p[i] = i;
        for (int i = 1; i <= n; i++) {
            int x = sc.nextInt();
            x = find(x);
            out.print(x + " ");
            p[x] = x + 1;
        }
        out.println();
        out.flush();
    }

    static int find(int x) {
        if (x != p[x]) p[x] = find(p[x]);
        return p[x];
    }

//    public static void main(String[] args) {
//        n = sc.nextInt();
//        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
//        for (int i = 0; i < N; i++) {
//            l[i] = i - 1;
//            r[i] = i + 1;
//        }
//        st[a[1]] = true;
//        del(a[1]);
//        for (int i = 2; i <= n; i++) {
//            if (st[a[i]]) {
//                for (int j = a[i]; st[j]; j = r[j], a[i] = j);
//            }
//            del(a[i]);
//            st[a[i]] = true;
//        }
//        for (int i = 1; i <= n; i++) out.print(a[i] + " ");
//        out.println();
//        out.flush();
//    }
//
//    static void del(int x) {
//        l[r[x]] = l[x];
//        r[l[x]] = r[x];
//    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

